package com.dhj.lambdaTest;

public class Demo6 {

    public static void main(String[] args) {
        check("hello", "o", new FuncTwo() {
            @Override
            public int doThing(String str, String s) {
                return str.indexOf(s);
            }
        });

        check("word", "o", (str, s) -> str.indexOf(s));

        check("word", "o", String::indexOf);

    }

    private static void check(String str, String s, FuncTwo funcTwo) {
        int num = funcTwo.doThing(str, s);
        System.out.println(num);
    }
}


interface FuncOne {
    boolean doThing(String str);
}


interface FuncTwo {
    int doThing(String str, String s);
}

